How to use - Properties

Remember the import

import vcCore as vc

Read/write built-in properties

You can access built-in properties directly from the object. These properties are documented in the API.

# write value to built-in property
comp = vc.getComponent()
comp.Name = "MyNewComponent"

Creating user-defined properties

To create a custom property, use the component's property container. If the property already exists, the create method will return the existing property.
Note: One of the arguments for the create method is a vcPropertyType enum.

# create a new user-defined component property
comp = vc.getComponent()
propery_container = comp.Properties
my_prop = propery_container.create(vc.vcPropertyType.STR,"MyStringProperty")

Read/write user-defined properties

Access user-defined properties (e.g., component properties) through the property container.

# write value to user-defined component property
comp = vc.getComponent()
my_prop = comp.Properties["MyStringProperty"]
my_prop.Value = "hello world"

Waiting for a property value change

For more information, see How to use - Events